/** \file TypeInfo_t.cc 
 * Test definitions for the class TypeInfo.
 *
 * (c) Copyright Semih Cemiloglu
 * All rights reserved, see COPYRIGHT file for details.
 *
 * $Id: TypeInfo_t.cc 119 2006-06-21 04:57:25Z semihc $
 *
 *
 */

#include "TypeInfo_t.hh"
#include <QtTest/QtTest>
#include "TypeInfo.hh"
#include "Debug.hh"

using namespace std;
using namespace TC;


namespace {

  struct MyType1 {};
  struct MyType2 {};
  struct MyType3 
  {
    int m_int;
  };

}


void TypeInfo_t::tests()
{
  TypeInfo t1;
  // Default construction
  QVERIFY(true);

  TypeInfo t2(typeid(MyType1));
  QVERIFY(t2.getInfo() == typeid(MyType1));

  TypeInfo t3(typeid(MyType2));
  QVERIFY(t1.getInfo() != t3.getInfo());
  QVERIFY(t1.getInfo() != t2.getInfo());

  const char* name = t3.name();
  QVERIFY(name);
  QVERIFY(name == t3.getInfo().name());
  QVERIFY(name == typeid(MyType2).name());
    
    
  QVERIFY(!t1.before(TypeInfo()));

  QVERIFY(t1 == TypeInfo());
}
  


